<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div class="he">
        鼠标划入改变
    </div>
</body>
</html>
<style>
    .he{
        width: 200px;
        height: 200px;
        background-color: black;
        color: blanchedalmond;
        margin: 10px auto;
    }
</style>
<script>
    var gai=document.querySelector(".he")
    gai.onmouseover=function(){
        this.style.width="170px"
        this.style.height="170px"
        this.style.backgroundColor="#ccc"
        this.style.border="30px solid red"
    }
    gai.onmouseout=function(){
        this.style.width="200px"
        this.style.height="200px"
        this.style.backgroundColor="black"
        this.style.border="0"
    }
</script>